package com.powergisol.gis.controller;

import com.powergisol.gis.service.TabDataSettingService;
import com.powergisol.gis.vo.TabUserVo;
import org.springframework.beans.factory.annotation.Autowired;
import java.security.Principal;
import java.util.Map;

public abstract class BaseController {
    @Autowired
    private TabDataSettingService tabDataSettingService;

    protected TabUserVo getUser(Principal p) {
//        Map<String,Object> map = tabDataSettingService.getByUserName(p.getName());
//        TabUserVo vo = new TabUserVo();
//        vo.setId(Integer.parseInt(map.get("id").toString()));
//        vo.setName(map.get("userName").toString());
//        return vo;
        TabUserVo vo = new TabUserVo();
        vo.setId(1);
        vo.setName("admin");
        return vo;
    }
}
